Skip to content

Conversation

ddustin
Copy link
Collaborator

@ddustin ddustin commented Aug 13, 2025

Enable cross channel splices in splice script

@ddustin ddustin force-pushed the ddustin/cross_splice_script branch from 023dc5a to f620dcd Compare August 13, 2025 14:39
Turns on mutli channel splices in splice script and adds a test for it.

Changelog-Changed: Splice script now supports splicing over multiple channels
@ddustin ddustin force-pushed the ddustin/cross_splice_script branch from f620dcd to 05a41bf Compare August 15, 2025 13:08
`bitcoin_tx_input_weight` already adds the prefix byte for counting the witness items
@ddustin ddustin force-pushed the ddustin/cross_splice_script branch from fee5cb4 to 3f5ce3e Compare August 16, 2025 02:13
In splicing logs we’re often outputting msat values next to sat values, making understanding the logs difficult.

Adding a way to output msats as sats with a decimal makes these logs much easier to read.
Since channeld handles splicing, it makes sense that it knows the opening feerate now. This is needed for rounding out splice script errors and logging.
On the rare chance a channel id starts with 02 or 03 we need to check of it’s referring to a channel before parsing it node id, instead of after.
Here we update `psbt_input_get_weight` to allow the caller to specify what kind of input size estimation they would like. Before it was just “zero witness bytes” which we now move to the default behavior and add an assumption option for P2WSH -> 2of2 multisig which is what we typically see in splicing.

At the same time we move channeld over to using the opening feerate estimation instead of the less useful “max feerate.” We make splice script use this same feerate.

After auditing the feerates for these two places against each other and the actually created transaction, we implement some fixes making them all match.

While we’re here, we add relevant debug log messages.

Changelog-Changed: Audited and updated splice’s feerate calculations to be precise to the byte — a critical change to accomodate splice script.
When using wetlog we might not also have debug log enabled.
In some splice script failure modes, some memory is leaked.

These don’t occur in normal operation — just when an error occurs.

This cleans up those memory leaks.
Enable feerate checks for the test now that they’re working well
@ddustin ddustin force-pushed the ddustin/cross_splice_script branch from 3f5ce3e to a8b6647 Compare August 16, 2025 14:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant